#include <catch2/catch.hpp>

#include <unordered_set>

#include "solution.hpp"

using namespace solution_015;

TEST_CASE("15. 3Sum", "[015]") {

SECTION("example 1") {
    std::vector<int> arr{-1,0,1,2,-1,-4};
    auto triplets = Solution().threeSum(arr);
    CAPTURE(triplets);
    CHECK(triplets.size() == 2);
}

SECTION("example 2") {
    std::vector<int> arr;
    auto triplets = Solution().threeSum(arr);
    CHECK(Solution().threeSum(arr) == std::vector< std::vector<int> >());
}

SECTION("example 3") {
    std::vector<int> arr{0};
    auto triplets = Solution().threeSum(arr);
    CHECK(Solution().threeSum(arr) == std::vector< std::vector<int> >());
}

}
